
/*
 * Java class "Enemy.java" generated from Poseidon for UML.
 * Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
 * Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
 */
package jcs;

import java.lang.String;


/**
 * EnemyClass - basic data storage on enemies
 * nothing too fancy, just class fields, accessors, mutators, constructors
 * Cam, Charles, Josh, Steve, Yaser
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7f8d]
 * @author Josh McCurry
 */
public class Enemy {

  ///////////////////////////////////////
  // attributes


/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc9]
 */
    private double velocity; 

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc8]
 */
    private double bearing; 

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc7]
 */
    private double energy; 

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc6]
 */
    private double relativeBearing; 

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc2]
 */
    private String name; 

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc1]
 */
    private long ticks; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$f18cd5:ffe9d3c834:-7fb0]
 */
    private boolean seeking; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7ff3]
 */
    private int[] hits; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7ff2]
 */
    private int[] shots; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7f67]
 */
    private final int NUM_GUN_MODES = 4; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$aaa392:10004e10e23:-7ff6]
 */
    private TargetingMode[] mode; 

/**
 * <p>Represents ...</p>
 * @poseidon-object-id [sm$aaa392:10004e10e23:-7ff5]
 */
    private TargetingMode currentGun; 

   ///////////////////////////////////////
   // associations

/**
 * 
 * @poseidon-object-id [sm$89848d:ffe131bfd5:-7fc0]
 */
    private Coord coord; 


  ///////////////////////////////////////
  // operations


/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff6]
 * @param _name 
 * @param _seth 
 */
    public  Enemy(String _name, Seth _seth) {        
        name = _name;
        seeking = false;
        hits = new int[NUM_GUN_MODES];
        shots = new int[NUM_GUN_MODES];
        
        for(int i = 0; i < NUM_GUN_MODES; i++)
        {
            hits[i] = 1;
            shots[i] = 1;
        }
        
        mode = new TargetingMode[NUM_GUN_MODES];
        mode[0] = new LinearTargeting(_seth);
        mode[1] = new AntiGravTargeting(_seth);
        mode[2] = new AntiGravCTargeting(_seth);
        mode[3] = new GuessFactorTargeting(_seth);
    } // end Enemy        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff3]
 * @return 
 */
    public double getVelocity() {        
        return velocity;
    } // end getVelocity        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff2]
 * @param _velocity 
 */
    public void setVelocity(double _velocity) {        
        velocity = _velocity;
    } // end setVelocity        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff5]
 * @return 
 */
    public double getBearing() {        
        return bearing;
    } // end getBearing        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff4]
 * @param _bearing 
 */
    public void setBearing(double _bearing) {        
        bearing = _bearing;
    } // end setBearing        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fef]
 * @return 
 */
    public double getEnergy() {        
        return energy;
    } // end getEnergy        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fee]
 * @param _energy 
 */
    public void setEnergy(double _energy) {        
        energy = _energy;
    } // end setEnergy        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fed]
 * @return 
 */
    public double getRelativeBearing() {        
        return relativeBearing;
    } // end getRelativeBearing        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fec]
 * @param _relativeBearing 
 */
    public void setRelativeBearing(double _relativeBearing) {        
        relativeBearing = _relativeBearing;
    } // end setRelativeBearing        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7feb]
 * @return 
 */
    public String getName() {        
        return name;
    } // end getName        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fea]
 * @param _name 
 */
    public void setName(String _name) {        
        name = _name;
    } // end setName        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fe9]
 * @return 
 */
    public long getTicks() {        
        return ticks;
    } // end getTicks        

/**
 * 
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7fe8]
 * @param _ticks 
 */
    public void setTicks(long _ticks) {        
        ticks = _ticks;
    } // end setTicks        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff1]
 * @return 
 */
    public Coord getCoord() {        
        // your code here
        return coord;
    } // end getCoord        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$afbf49:ffe968022d:-7ff0]
 * @param _coord 
 */
    public void setCoord(Coord _coord) {        
        coord = _coord;
    } // end setCoord        

/**
 * <p>Represents ...</p>
 * 
 * @poseidon-object-id [sm$f18cd5:ffe9d3c834:-7fb1]
 * @return 
 */
    public boolean isSeeking() {        
        return seeking;
    } // end isSeeking        

/**
 * <p>Represents ...</p>
 * 
 * @poseidon-object-id [sm$f18cd5:ffe9d3c834:-7fae]
 * @param _seeking 
 */
    public void setSeeking(boolean _seeking) {        
        seeking = _seeking;
    } // end setSeeking        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7ff5]
 * @param i 
 */
    public void incrementHit(int i) {        
        hits[i]++;
    } // end incrementHit        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7ff6]
 * @return 
 * @param i 
 */
    public double getRatio(int i) {        
        return (double)hits[i] / (double)shots[i];
    } // end getRatio        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$aaca8a:ffff2170b8:-7fe9]
 * @param i 
 */
    public void incrementShots(int i) {        
        shots[i]++;
    } // end incrementShots        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$aaa392:10004e10e23:-7ff4]
 * @param _currentGun 
 */
    public void setGun(int _currentGun) {        
        currentGun = mode[_currentGun];
    } // end setGun        

/**
 * <p>Does ...</p>
 * 
 * @poseidon-object-id [sm$aaa392:10004e10e23:-7ff3]
 * @return 
 * @param gun 
 */
    public TargetingMode getGun(int gun) {        
                	TargetingMode gunMode = null;
        		if(gun < mode.length)
        		{
        			gunMode = mode[gun];
        		}
        		return gunMode;
    } // end getGun        

 } // end Enemy


